package com.eastedu.controller;

import com.eastedu.domain.ObjectValueModel;
import com.eastedu.model.RequestParameter;
import com.eastedu.superise.handler.preparing.PreparingUpdateTimeHistoricalDataHandler;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * The type Question data update controller.
 * @author 袁松明
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/api/v1/preparing/data-update")
public class PreparingDataUpdateController {

    private final PreparingUpdateTimeHistoricalDataHandler preparingUpdateTimeHistoricalDataHandler;


    /**
     * 根据章节点更新受影响的资源
     * @param parameter 请求参数
     * @return 结果 http entity
     */
    @PostMapping("/update-time")
    public HttpEntity<ObjectValueModel<Boolean>> insertKnowledge(RequestParameter parameter) {
        preparingUpdateTimeHistoricalDataHandler.handle(parameter);
        return ResponseEntity.ok(new ObjectValueModel<>(Boolean.TRUE));
    }



}
